package apIExercise.io.io2;

import java.io.*;

public class CogyDeomeBuffered {
    public static void main(String[] args) throws IOException {
        /*
        FileInputStream fis=new FileInputStream("blr.jpg");
        BufferedInputStream bis=new BufferedInputStream(fis);
        FileOutputStream fos=new FileOutputStream("blr_9.jpg");
        BufferedOutputStream bos=new BufferedOutputStream(fos);
        long start=System.currentTimeMillis();
        int len;
        while ((len=bis.read())!=-1){
            bos.write(len);
        }
        long end=System.currentTimeMillis();
        System.out.println("复制完成！"+(end-start)+"ms");
        bis.close();
        bos.close();

         */
        FileInputStream fis=new FileInputStream("blr.jpg");
        BufferedInputStream bis=new BufferedInputStream(fis);
        FileOutputStream fos=new FileOutputStream("blr_8.jpg");
        BufferedOutputStream bos=new BufferedOutputStream(fos);
        int a;
        while ((a=bis.read())!=-1){
            bos.write(a);
        }
        System.out.println("复制完毕！");
        bis.close();
        bos.close();
    }
}
